package org.demo.db.meta;
/**
 * database table index info
 * @author  
 * @date    2010-9-6
 * @file    org.demo.db.meta.Index.java
 */
public class Index {
	// 索引名称
	private String name;
	// 索引类型
	private String type;
	// 表 schema
	private String tableSchema;
	// 表名称
	private String tableName;
	// 列名称
	private String columnName;
	// 索引列序号
	private short position;
	// 索引是否唯一
	private boolean unique;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getTableSchema() {
		return tableSchema;
	}
	public void setTableSchema(String tableSchema) {
		this.tableSchema = tableSchema;
	}
	public String getTableName() {
		return tableName;
	}
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}
	public String getColumnName() {
		return columnName;
	}
	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}
	public short getPosition() {
		return position;
	}
	public void setPosition(short position) {
		this.position = position;
	}
	public boolean isUnique() {
		return unique;
	}
	public void setUnique(boolean unique) {
		this.unique = unique;
	}
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Index [name=").append(name);
		builder.append(", type=").append(type);
		builder.append(", tableSchema=").append(tableSchema);
		builder.append(", tableName=").append(tableName);
		builder.append(", columnName=").append(columnName);
		builder.append(", position=").append(position);
		builder.append(", unique=").append(unique);
		builder.append("]");
		return builder.toString();
	}
}
